home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / libs / libmodem.99 < prev    next >
Text File  |  1996-11-17  |  3KB  |  81 lines

  1.                             LIBMODEM
  2.  
  3. Version:       0.99.2 (ALPHA)
  4. Author:        Riccardo Facchetti
  5. e-mail:        riccardo@cdc8g5.cdc.polimi.it
  6. Copyright:     (C) 1994, 1995 Riccardo Facchetti under the terms of the
  7.                GNU Library General Public Licence
  8.  
  9. WHAT IS THIS ?
  10. libmodem.a is a library that allow you to use your modems transparently with
  11. regard of kind of modem attached to a line. You have just to
  12.  
  13. int fd;
  14. ...
  15. fd = dial("Some-phone-number");
  16. ...
  17.  
  18. and it will return to you a file descriptor of the dialed line.
  19. To hangup just hangup(fd).
  20. Of course, you have to configure all your modem lines in the /etc/modems file to
  21. allow the library know which modem lines it can use to dial.
  22.  
  23. NOTES:
  24. libmodem is written for Linux, but i think you can easily port this package on
  25. other platforms (that have POSIX_TERMIOS of course :))
  26. This is an ALPHA version of the code, developed as modem library for another
  27. package. The library libmodem is distributed as a package, subjected to the
  28. GNU LIBRARY GENERAL PUBLIC LICENSE
  29. This package permit dialout only (for now). In the future, i think i will write
  30. the routines that manage dialin connections too.
  31.  
  32. TANKS:
  33. Some parts of the code (mainly termios setup) are based on the work
  34. of Gert Doering (mgetty-0.21):
  35. thanks Gert, without your code i couldn't write down the termios spaghetti.
  36. In no way Gert is responsible for the pieces of code i'd stole from his mgetty.
  37.  
  38. HISTORY:
  39. I needed a modem library that with a single function call allows me to
  40. dial a remote modem, and returns a file descriptor that i can use,
  41. dupping it to stdin and stdout. This is a part of a project of
  42. communication software: a 2nd level password protection for a Linux box
  43. used as terminal server (here in Italy we still have not enabled the CallerID).
  44.  
  45. I've searched for such a modem package and i've found a little but promising
  46. package called libmodemcap. It is a package that manage modems with a file
  47. a la termcap. After unpacking and examination of the package i've pointed
  48. out at least two important things that make libmodemcap not the Right Thing for
  49. me:
  50.  
  51. 1)  It have little or nothing at all control over modem talking (here i mean
  52.     write INIT string
  53.         Wait 'OK'
  54.         Check 'OK'
  55.     write CALL string
  56.         Wait 'CONNECT'
  57.         Check 'CONNECT'
  58.     write HANGUP string
  59.         Wait 'OK' ... maybe
  60.         Check 'OK' ... maybe
  61.     )
  62.     It lacks 'Wait <something>' just to be sure the modem have done what you
  63.     just asked it to do; was a little problem, but present (to be truth that was
  64.     a major problem for me: i don't want a modem be hung without a way to know
  65.     that it must be reset!!!).
  66.  
  67. 2)  Look at its copyright. It is not GPL, it is something i don't like too much.
  68.  
  69. 3)  ...
  70.  
  71. Anyway thanks to John F. Haugh II (the author of libmodemcap) for having made me
  72. write this package (in fact i don't know him, i never heard nothing about him,
  73. and i suppose he's never heard nothing about me :)
  74.  
  75. JUST ANOTHER WORD:
  76. The decision to write libmodem was not only reached for the above reasons.
  77. I have not found a similar package in the Linux distributions and ftp sites.
  78. So I've written this package for the Linux community.
  79.  
  80. Guys, enjoy it!
  81.